<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<meta property="og:title" content="Netisme - Articles, tutorials and resources about Web Development" />
<script>
function fbs_click()
 {
 u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
 
 </script>
 
 <style>
html .fb_share_button 
{ 
  display: -moz-inline-block; 
  /*display:inline-block;*/
  padding:1px 20px 0 5px;
  height:15px;
  color:#FFFFFF;
  border:1px solid #d8dfea; 
  background: #3b5998 url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right;
} 
html .fb_share_button:hover 
{ 
	color:#fff; 
	border-color:#295582; 
	background:#3b5998 url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; 
	text-decoration:none; 
} 
</style>
<?php
include('includes/connect.php');
$user=$_POST['user'];
$Questions_ID=$_POST["questions_id"];
$Options_ID=$_POST["options1"];
$attempts=$_POST["attempts"];

if(isset($attempts) && $attempts!='1')
{
		$usr=mysql_query("select * from user_attempt where user='".$user."'");
		$fetch=mysql_fetch_array($usr);
		$ud=$fetch['user_attempt'];	
			  if(mysql_num_rows($usr)>0)
			  {
			    //$user_attempt1=1;
				$user_attempt=	$ud+1;
				
				$s=mysql_query("update user_attempt set user_attempt='".$user_attempt."' where user='".$user."'");
				}
		  	  else
			  {
			  	$user_attempt1=1;
				$s=mysql_query("insert into user_attempt(`user`,`user_attempt`)values('$user','$user_attempt1')");
			  }	
			  
			  if($s)
				{
																	 
						      $usr1=mysql_query("select * from user_attempt where user='".$user."'");
							  $ui_fetch1=mysql_fetch_array($usr1);
							  $attemt_id=$ui_fetch1['user_attempt'];
							  $user_id=$ui_fetch1['uid'];
							   									
							$s1=mysql_query("INSERT INTO test_attempted(`uid`,`qid`,`opt_id`,`attemt_id`)VALUES('$user_id','$Questions_ID','$Options_ID','$attemt_id')");
							
				}
}
else {

													 
						      $usr1=mysql_query("select * from user_attempt where user='".$user."'");
							  $ui_fetch1=mysql_fetch_array($usr1);
							  $attemt_id=$ui_fetch1['user_attempt'];
							  $user_id=$ui_fetch1['uid'];
							   									
							$s1=mysql_query("INSERT INTO test_attempted(`uid`,`qid`,`opt_id`,`attemt_id`)VALUES('$user_id','$Questions_ID','$Options_ID','$attemt_id')");
				
}
$sql=mysql_query("select count(*) as count from test_attempted as ta,user_attempt as uat where ta.uid=uat.uid and uat.user='".$user."' and attemt_id=".$attemt_id);
$counting=mysql_fetch_array($sql);
$count= $counting['count'];

?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
</head>
<body>

    
    <div style="text-align:left"><b>Question  :</b><?php echo $_POST["questions"]; ?></div>
    <br>
    <table border="0" width="700px">
    	<tr><td><img src="images/img.gif"  style="width:300px" height="200px"></td>
        <td>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of </td></tr>
		<tr><td>&nbsp;</td><td><a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" class="fb_share_button" onClick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a>&nbsp;&nbsp;<a href="index.php?attempt=1&qattno=<?php echo $count;?>&user=<?php echo $user_id; ?>&attno=<?php echo $attemt_id; ?>" style="text-decoration:none;"><input type="submit" value="next" class="submit"></a></td></tr>
    </table>
    <br>
    <br>
    <a href="qtq.php" class="su" style="text-decoration:none;">Take QTQ Test</a>&nbsp;&nbsp;<a href="qtp.php" style="text-decoration:none;" class="long_sub">Take Oreo Togetherness Pledge</a>
   
</body>
</html>
